var FormData = require('form-data');
const axios = require('axios')

let fd = new FormData()
fd.append('api_key', 'WjbpXhAj1fkJWQdwAEGxq2-HS8K8g9q0')
fd.append('api_secret', 'p0Amm5Qfkz2PApM6OIcY-Xiir6ZEhloN')
fd.append('image_url', 'https://img0.baidu.com/it/u=3860515007,3225442203&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=700')
const options = {
  method: 'POST',
  headers: { 'content-type': 'multipart/form-data' },
  data: fd,
  url: 'https://api-cn.faceplusplus.com/facepp/v3/detect',
};
axios(options)
.then(function (response) {
  console.log('response')
  console.log(JSON.stringify(response.data, null, 2));
})
.catch(function (error) {
  console.log('error');
  console.log(error);
});